package com.study.feign;

import org.springframework.cloud.openfeign.FeignClient;

import com.config.UserConfiguration;
import com.study.dao.entity.MovieUser;

import feign.Param;
import feign.RequestLine;

@FeignClient(name = "sunxj-microservice-provider-user", configuration = UserConfiguration.class,
             fallback = UserFeignClientFallback.class)
public interface UserFeignClient {
	
	/**
	 * 自定义feign.Contract：
	 * 
	 * 
	 * 使用SpringMvcContract的契约方式：
	 *    @RequestMapping(value="/simple/{id}", method = RequestMethod.GET)
	 *    public MovieUser selectById(@PathVariable("id") int id);
	 * 使用feign自己的契约方式：
	 *    @RequestLine("GET /simple/{id}")
	 *    public MovieUser selectById(@Param("id") int id);
	 */
	
	@RequestLine("GET /simple/{id}")
	public MovieUser selectById(@Param("id") int id);
	
}
